﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataLib.Accounts.Bus;
using System.Data;

namespace Ewts.Project
{
    public partial class CustomerList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Session["UserInfo"] != null)
                {
                    User curUser = new DataLib.Accounts.Bus.User();
                    curUser = (User)Session["UserInfo"];
                    
                    binddata(curUser.UserName);
                }
                else
                {
                    Response.Redirect("/accounts/login.aspx");
                }


            }
       
        }
        private void binddata(string username)
        {
            DataTable dt = new DataLib.BLL.ProjectsRelation().getProjectByUserName(username, 0);
            reptCustomer.DataSource = dt;
            reptCustomer.DataBind();
        
        }
    }
}